<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Powered by 9416.cn</title>


<!--#include file="../inc/conn.asp"-->


<script type="text/javascript" src="../ui/jquery.js"></script>
 <link rel="stylesheet" href="../ui/layui/css/layui.css" type="text/css"  />

<script type="text/javascript" src="../ui/layui/layui.js"></script>
 


</head>

<body>

<div class="mec_div" style="padding-top:0px; padding-bottom:20px;padding-left:20px;padding-right:20px;">
<div class="layui-tab layui-tab-brief">
<ul class="layui-tab-title site-demo-title">
   <li ><a href="user_set.asp">设置</a></li>
     <li class="layui-this"><a href="user_list.asp">会员列表</a></li>
<li ><a href="user_point.asp">会员积分</a></li>
   
  </ul>
  </div>
   <%jianbook.qxmsg()%>
 <div class="layui-form ">
 
 
  <div class="layui-inline">
      
      <div class="layui-input-inline" style="width: 100px;">
        <input type="text" name="date_min" placeholder="开始日期" autocomplete="off" class="layui-input date">
      </div>
      <div class="layui-input-inline">-</div>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="text" name="date_max" placeholder="结束日期" autocomplete="off" class="layui-input date">
      </div>
    </div>
  
  <div class="layui-inline">
 
    <input class="layui-input" name="key" id="demoReload" autocomplete="off" placeholder="输入要查询的账号">
    </div>
      
  <button class="layui-btn" data-type="reload">搜索</button>
</div>
 

 <script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>

  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<table class="layui-hide" id="table" lay-filter="demo"></table>

</div>

<script>
layui.use('table', function(){
  var table = layui.table;

  //方法级渲染
  table.render({
    elem: '#table'
    ,url: '../inc/admin.asp?act=userlist'
	 ,toolbar: '#toolbarDemo'
    ,title: '用户数据表'
	,cellMinWidth: 100 
	
    ,cols: [[
	
	{field:'id', title: 'id',  sort: true}
     ,{field:'email', title: '账号',   sort: true}
	 ,{field:'username', title: '会员名',  sort: true}
	  ,{field:'lasttime', title: '最后登陆时间',  sort: true}
      ,{field:'ip', title: 'ip', sort: true}
      ,{field:'addr', title: '地址', sort: true}
	 ,{field:'num', title: '次数',  sort: true}
	  ,{field:'intime', title: '注册时间',  sort: true}
	 ,{fixed: 'right', title:'操作', toolbar: '#barDemo'}
     
	   
    ]]
    ,id: 'testReload'
    ,page: true
  ,limit:20
  });

  
  var $ = layui.$, active = {
    reload: function(){
      var demoReload = $('#demoReload');
      
      //执行重载
      table.reload('testReload', {
        page: {
          curr: 1 //重新从第 1 页开始
        }
        ,where: {
             date_min:  $('input[name=date_min]').val()
			  ,date_max:  $('input[name=date_max]').val()
			  ,key:  $('input[name=key]').val()
        }
		
      });
    }
  };
  
  $('.layui-form .layui-btn').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });
  
  
   //监听行工具事件
  table.on('tool(demo)', function(obj){
    var data = obj.data;
   var pid=obj.data["id"]
    if(obj.event === 'del'){
    layer.confirm('真的删除行么', function(index){
        $.ajax({
			type : "POST",
			cache : true,
			dataType : "json",
			url : "../inc/admin.asp?act=del_user",
			data:{"table":'user',"id":pid},
			success:function(data)
	{
		switch(data.status)
		{
		case "y":
	      obj.del();
			break;
		}
	}
	});
	 layer.close(index);
      });
	  
    } else if(obj.event === 'edit'){
     
	 tc('修改信息','user_edit.asp?id='+pid,400,300)
	 
    }
  });
  
  
  
  
  
  

});
</script>



<script type="text/javascript" src="../ui/pc.js"></script>	

</body>

</html>
